<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <!-- 事件处理的三种方式： -->
        <!-- 1、直接触发代码 -->
        <button @click="count+=1">加{{count}}</button>
        <!-- 2、通过函数的形式 -->
        <button @click="addClick">加{{count}}</button>
        <!-- 3、通过函数进行传参 -->
        <button @click="addClick(5)">加{{count}}</button>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        let vm=new Vue({
            el:"#app",
            data:{
                msg:"/(ㄒoㄒ)/~~",
                count:1
            },
            methods:{
                addClick:function(step){
                    this.count+=step;
                }

            }




        })







    </script>

</body>
</html>